<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>update_student</title>
</head>
<body>
<form action="" method="post">
    {% csrf_token %}
    <input type="text" hidden name="id" value="{{ blog.id }}">
    博客标题:<input type="text" name="title" value="{{ blog.title }}">&nbsp;&nbsp;
    <br>
    博客内容:
    <textarea name="content" id="content" cols="50" rows="10">
        {{ blog.content }}
    </textarea>

    <br>


    {#    {% for foo in blog.author. %}#}
    {##}
    {#    {% endfor %}#}
    选择作者:<select name="author" id="author">
    {% for author in authors %}
        {% if author.id == blog.author.id %}
            <option value="{{ author.id }}" name="{{ author.id }}" selected>{{ author.name }}</option>
        {% else %}
            <option value="{{ author.id }}" name="{{ author.id }}">{{ author.name }}</option>
        {% endif %}

    {% endfor %}

</select>

    {#    {% if blog.author.id == "1" %}#}
    {#        <select name="gender" id="gender">#}
    {#            <option value="0">女性</option>#}
    {#            <option value="1" selected>男性</option>#}
    {#        </select>#}
    {#    {% else %}#}
    {#        <select name="gender" id="gender">#}
    {#            <option value="0" selected>女性</option>#}
    {#            <option value="1">男性</option>#}
    {#        </select>#}
    {#    {% endif %}#}
    <br>
    <input type="submit" value="修改">
</form>
</body>
</html>